import axios from 'axios'
import prodList from './prodList'

export default {
    getDate() {
        return(dispatch) => {
            axios.get('https://shopapi.smartisan.com/product/skus?ids=100057209,100057415,100058402,100039719,100047001,100055601,100055301,100042203,100052801,100042801,100026701,100053314,100057220,100057415,100057603,100053202,100023501,100042203,100042803,100053001,100052803,100055302,100026801,100042205,100033802,100040501,100036501,100036401,100051706,100051704,100026701,100047101,100026801,100042206,100023501,100053002&with_stock=true&with_spu=true').then(res => {
                // console.log(res)
                dispatch({
                    type: 'GETDATE',
                    dataList: res.data.data.list
                })
            })
        }
    },
    getProdId() {
        let prodIdList = prodList.floors
        console.log(prodIdList)
        return {
            type: 'PRODID',
            hotProd: prodIdList[0].dataList,
            bagDress: prodIdList[1].dataList,
            parts: prodIdList[2].dataList,
            breathing: prodIdList[3].dataList,
            phone: prodIdList[4].dataList
        }
    }
}